//help.js
const app = getApp()
const util = require('../../utils/util.js')

Page({
  data: {
    activeName: 0,
    list:[]
  },
  onChange(event) {
    this.setData({
      activeName: event.detail
    });
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad:function(options){
    this.help()
  },
  help:function(){
    var that = this;
    var data = {};
    wx.showLoading({
      title: '加载中...',
    })
    app.post('identity/help', data).then((res) => {
      wx.hideLoading();
      if (res.code == 200) {
        that.setData({
          list:res.list
        })
      } 
    }).catch((errMsg) => {
      console.log(errMsg);
      wx.hideLoading();
      wx.showToast({
        title: "网络错误",
        icon: 'loading',
        duration: 2000
      })
    })
    wx.stopPullDownRefresh()
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    this.help()
  }
})